package com.miyu.system.pojo.system;

import cn.hutool.core.date.LocalDateTimeUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.miyu.system.utils.jpacomment.annotation.ColumnComment;
import com.miyu.system.utils.jpacomment.annotation.TableComment;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.Data;

/**
 * 字典主表;
 * @author : miyu
 * @date : 2025-3-23
 */
@ApiModel(value = "字典主表",description = "")
@Data
@Entity
@Table(name="sys_dict")
@TableComment("字典主表")
public class SysDict implements Serializable {
    /** 主键;主键 */
    @Id
    @TableGenerator(name="id_gen",  table="sys_id_generator", pkColumnName="table_name", pkColumnValue="sys_dict", valueColumnName="id_value", initialValue=1, allocationSize=1)
    @GeneratedValue(strategy=GenerationType.TABLE, generator="id_gen")

    @ApiModelProperty(value="主键",notes = "主键")
    @Column(name = "dict_id", nullable = false,length=11 )
    @ColumnComment("主键")
    private Integer dictId ;
    /** 字典编码;字典编码 */
    @ApiModelProperty(value="字典编码",notes = "字典编码")
    @Column(name = "dict_code", nullable = false,length=50 )
    @ColumnComment("字典编码")
    private String dictCode ;
    /** 字典名称;字典名称 */
    @ApiModelProperty(value="字典名称",notes = "字典名称")
    @Column(name = "dict_name", nullable = true,length=30 )
    @ColumnComment("字典名称")
    private String dictName ;
    /** 是否停用;是否停用 */
    @ApiModelProperty(value="是否停用",notes = "是否停用")
    @Column(name = "is_stop", nullable = false,length=1 )
    @ColumnComment("是否停用")
    private String isStop = "0" ;
    /** 数据来源;数据来源0 手动录入 1 sql */
    @ApiModelProperty(value="数据来源",notes = "数据来源0 手动录入 1 sql")
    @Column(name = "data_source", nullable = false,length=1 )
    @ColumnComment("数据来源")
    private String dataSource = "0" ;
    /** 是否树状结构;是否树状结构 */
    @ApiModelProperty(value="是否树状结构",notes = "是否树状结构")
    @Column(name = "is_tree", nullable = true,length=1 )
    @ColumnComment("是否树状结构")
    private String isTree = "0" ;
    /** 有效值;有效值 */
    @ApiModelProperty(value="有效值",notes = "有效值")
    @Column(name = "display_value", nullable = true,length=30 )
    @ColumnComment("有效值")
    private String displayValue = "value" ;
    /** 显示值;显示值 */
    @ApiModelProperty(value="显示值",notes = "显示值")
    @Column(name = "display_name", nullable = true,length=30 )
    @ColumnComment("显示值")
    private String displayName = "label" ;
    /** 是否缓存;是否缓存（针对sql是否redis缓存） */
    @ApiModelProperty(value="是否缓存",notes = "是否缓存（针对sql是否redis缓存）")
    @Column(name = "is_cache", nullable = true,length=1 )
    @ColumnComment("是否缓存")
    private String isCache = "1" ;
    /** 备注说明;备注说明 */
    @ApiModelProperty(value="备注说明",notes = "备注说明")
    @Column(name = "remark", nullable = true,length=200 )
    @ColumnComment("备注说明")
    private String remark ;
    /** 创建日期;创建日期 */
    @ApiModelProperty(value="创建日期",notes = "创建日期")
    @Column(name = "create_date", nullable = true )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ColumnComment("创建日期")
    private LocalDateTime createDate ;
    /** 创建人 */
    @ApiModelProperty(value="创建人",notes = "")
    @Column(name = "create_user", nullable = true,length=30 )
    @ColumnComment("创建人")
    private String createUser ;

    /** 更新日期;更新日期 */
    @ApiModelProperty(value="更新日期",notes = "更新日期")
    @Column(name = "update_date", nullable = true )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ColumnComment("更新日期")
    private LocalDateTime updateDate = LocalDateTimeUtil.now() ;
}